/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package gl;

import carte.Carte;
import java.awt.BorderLayout;
import java.util.ArrayList;
import java.util.Iterator;
import javax.swing.JPanel;
import javax.swing.JTextArea;
import perso.Personnage;

/**
 *
 * @author Administrateur
 */
public class DisplayConsole implements Itf_Display {
    JTextArea textArea;

    @Override
    public void displayInfo(ArrayList<Personnage> listPerso, Carte carte) {
        String message = "";
        Iterator<Personnage> itr = listPerso.iterator();
                while (itr.hasNext()) {
                    Personnage perso = itr.next();
                    message+=perso.name+ "\t  id:" +perso.id+"\tpx: "+perso.px+"\tpy: "+perso.py+"\n";
                }
        textArea.setText(message);
    }

    @Override
    public void setParam(int nbrX, int nbrY,JPanel panel_game) {
         textArea= new JTextArea("");
         textArea.setFont(new java.awt.Font("Tahoma", 0, 16));
         panel_game.setLayout(new BorderLayout());
        panel_game.add(textArea,BorderLayout.CENTER);
    }
    
}
